﻿Imports GameEngine
Imports Microsoft.Xna.Framework
Imports Microsoft.Xna.Framework.Graphics

Public Class TestScreen
    Inherits GameScreen

    Public Overrides ReadOnly Property ScreenName() As String
        Get
            ScreenName = "TestScreen"
        End Get
    End Property

    Public Sub New(ByVal GameManager As GameManager)
        MyBase.New(GameManager)
    End Sub

    Public Overrides Sub Initialize()

        ' Characters
        Characters.Add(New Windmill(GameManager, Me))
        Characters(0).IsActive = False

        ' Objects
        Objects.Add(New ReferenceObjects(GameManager))

        ' Scenery
        Dim t As New AutoTerrain(GameManager, 5)
        t.Colors.Add(Color.Blue)
        t.Colors.Add(Color.Green)
        t.Colors.Add(New Color(64, 0, 0))
        t.Colors.Add(Color.Gray)
        t.Colors.Add(Color.Snow)
        t.Colors.Add(Color.White)
        Terrain.Add(t)
        'Terrain.Add(New Terrain(GameManager))

        ' Camera
        Camera = New Camera3D(GameManager)
        Camera.CameraMode = CameraMode.ThirdPerson
        Camera.TrackedCharacter = Characters(0)
        Camera.DesiredPositionOffset = Vector3.Backward * 20
        Camera.StrafeUp(50.0F)
        Camera.MoveBackwards(100.0F)
        Camera.LookAtPoint(Vector3.Zero, 1)

        MyBase.Initialize()

    End Sub

    Public Overrides Sub LoadContent()
        Terrain(0).HeightMap = GameManager.Game.Content.Load(Of Texture2D)("heightmap")

        MyBase.LoadContent()
    End Sub
    Public Overrides Sub HandleInput(ByVal input As GameEngine.IGamePadInputManager)
        MyBase.HandleInput(input)

        If input.BackPressed Then
            GameManager.Exit()
            Exit Sub
        End If

        Camera.HandleInput(input)

    End Sub

End Class